#Figures 2 and 3

load("Amnesty Provision Main Data.Rdata")

fig2<-ggplot(data, aes(Year, fill=as.factor(Amn)))+
  geom_bar(position = "stack")+
  theme(legend.position = "top")+
  labs(fill = "Amnesty Provision")+
  ylab("Number of Agreements")+
  scale_fill_manual(values=viridis_pal()(3)[c(1,2)])
fig2

pdf(file="Fig2.pdf", height = 4, width = 4)
print(fig2)
dev.off()

fig3<-ggplot(data, aes(fragmentation2, fill=as.factor(Amn), color=as.factor(Amn)))+
  geom_density(alpha=.75, color=NA) + 
  labs(color="Amnesty Provision", fill="Amnesty Provision")+
  ylab("Density")+
  xlab("Average Substitutes")+
  scale_fill_manual(values=viridis_pal()(3)[c(1,2)])+
  theme_bw()+
  theme(legend.position="top")


fig3
pdf("Fig3.pdf", height = 4, width = 4)
print(fig3)
dev.off()

rm(list=setdiff(ls(), c("cluster_bootstrap", "int_plot")))
